using System.Data;

namespace Caam.Framework.Common
{
    public interface IDbManager
    {

        DataProvider ProviderType { get;set;}

        string ConnectionString { get;set;}
        bool MustDispose { get; set; }

        IDbConnection Connection
        {
            get;
        }
        IDbTransaction Transaction
        {
            get;
        }

        IDataReader DataReader
        {
            get;
        }
        IDbCommand Command
        {
            get;
        }

        IDbDataParameter[] Parameters
        {
            get;
        }

        void Open();
        void BeginTransaction();
        void CommitTransaction();
        void RollbackTransaction(); //16/10/2009 - lbnam04
        void CreateParameters(int paramsCount);
        void AddParameter(int index, string paramName, object objValue);
        void AddParameter(int index, IDbDataParameter param);
        void AddOutParameter(int index, string paramName, object dbType);
        void AttachParameters(IDbDataParameter[] commandParameters);

        IDataReader ExecuteReader(CommandType commandType, string
        commandText);
        DataSet ExecuteDataSet(CommandType commandType, string
        commandText);

        DataTable ExecuteDataTable(CommandType commandType, string
        commandText);
        DataTable ExecuteDataTable(string commandText);
        //DataTable ExecuteDataTableV2(CommandType commandType, string commandText);

        object ExecuteScalar(CommandType commandType, string commandText);
        object ExecuteScalarV2(CommandType commandType, string commandText);
        int ExecuteNonQuery(CommandType commandType, string commandText);
        int ExecuteNonQueryV2(CommandType commandType, string commandText);

        object GetParameterValue(string paramName);

        void CloseReader();
        void Close();
        void Dispose();

    }
}
